import sys
from PyQt6.QtWidgets import QApplication
from main_window import MainWindow

def main():
    print("程序开始运行...")
    try:
        app = QApplication(sys.argv)
        print("QApplication 创建成功")
        
        window = MainWindow()
        print("MainWindow 创建成功")
        
        window.show()
        print("窗口显示命令已执行")
        
        return app.exec()
    except Exception as e:
        print(f"发生错误: {str(e)}")
        return 1

if __name__ == "__main__":
    print("正在启动应用...")
    sys.exit(main()) 